/* Reservation.java
 * 
 * Class that holds information of a reservation
 * of a given tour offering. Most information is
 * set in the constructor, optional information
 * (for solo reservation) can be filled in through
 * setter methods. A toString method provides a 
 * clean printout of all the information for the
 * reservation
 * 
 * Greg Warner
 * Derek Dupuis
 * Michael Dixey
 * Alex Schwartz
 */

import java.util.*;

public class Reservation
{
   /* class variables */
   public String travelerName;
   public String offeringName;
   public String status;
   public int fitnessLvl;
   public int gender;
   public int age;
   public int roomNo;
   public String partner;
   public String city;
   public String state;
   
   /* constructor for Reservation Class */
   public Reservation( String tN, String oN, String st, String pN, int fL, String c, String s)
   {
      travelerName = tN;
      offeringName = oN;
      status = st;
      partner = pN;
      fitnessLvl = fL;
      city = c;
      state = s;
   }
   
   /* accessor methods */
   public String travelerName() { return travelerName; }
   
   public String offeringName() { return offeringName; }
   
   public String status() { return status; }
   
   public String partner() { return partner; }
   
   public int fitnessLvl() { return fitnessLvl; }
   
   public int gender() { return gender; }
   
   public int age() { return age; }
   
   public int roomNumber() { return roomNo; }
   
   public String city() { return city; }
   
   public String state() { return state; }
   
   
   /* setter methods */
   public void setGender( int g ) 
   { 
      gender = g;
   }
   
   public void setAge( int a ) 
   { 
      age = a;
   }
   
   public void setRoomNumber( int rn ) 
   { 
      roomNo = rn;
   }
   
   public void setPartner( String p )
   {
      partner = p;
   }
   
   /*Reservation toString() - prints in nicely formatted form
    * requires wide window to see all information without line wraps
    * */
   public String toString()
   {
      String s = String.format( "\tTraveler: %13s   Offering: %s   " + 
                               "Status: %7s   Parner: %13s   Room: %d   Fitness: %d",
                               travelerName, offeringName, status.toUpperCase(),
                               partner, roomNo, fitnessLvl );
      
      if( status().compareTo( "solo" ) == 0 ){
         s += String.format( "   Age: %d", age);
      }
      s+= "\n";
      return s;
   }
   
}



